package cn.com.dhcc.adam.spring.container;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.com.dhcc.adam.spring.Service;

public class ConfigMetaData {
	public static void main(String[] args) {
		test1();
		test2();
		test3();
	}
	public static final void test1(){
		@SuppressWarnings("resource")
		ApplicationContext context =
				new ClassPathXmlApplicationContext(new String[] {"springcontainer/services.xml", "springcontainer/daos.xml"});
		Service srv = context.getBean(Service.class);
		System.out.println(srv.formatedInfo());
	}

	public static final void test2(){
		
		@SuppressWarnings("resource")
		ApplicationContext context =
				new ClassPathXmlApplicationContext(new String[] {"springcontainer/services2.xml"});
		Service srv = context.getBean("srv", Service.class);
		System.out.println(srv.formatedInfo());
	}
	
	public static final void test3(){
		@SuppressWarnings("resource")
		ApplicationContext context =
				new ClassPathXmlApplicationContext(new String[] {"springcontainer/services2.xml"});
		Service srv = context.getBean("testSrv", Service.class);
		System.out.println(srv.formatedInfo());
	}
}
